package com.bjzsly.star3.xyh.auth;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.widget.Toast;

/**
 * Created by ly on 2017/10/13.
 */

public class ShareCallBackActivity extends Activity {

    private boolean showDialog = false;
    private String coins;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);

        Uri uri = getIntent().getData();
        if (uri != null) {
            coins = uri.getQueryParameter("coins");
            if (!TextUtils.isEmpty(coins)) {
                showDialog = true;
                Toast.makeText(this, "分享成功", Toast.LENGTH_SHORT).show();
//                EventUtil.sendEvent(new CoinEvent(CoinEvent.TYPE.TYPE_SHARE_WX_CIRCLE));
            }
        }
    }


    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        finish();
        return super.dispatchTouchEvent(ev);
    }


}
